import { createSSRApp } from 'vue'
import App from './App.vue'
import * as Pinia from 'pinia'
import { createUnistorage } from 'pinia-plugin-unistorage'
import '@/uni.scss'

export function createApp() {
  const app = createSSRApp(App)
  
  // 创建Pinia实例
  const pinia = Pinia.createPinia()
  // 添加持久化插件
  pinia.use(createUnistorage())
  
  // 挂载Pinia
  app.use(pinia)

  return {
    app,
    pinia
  }
}
